<?php require VIEW_PATH."/header.php";?>
<body>

<div class="hd-menu-list">
    <ul>
        <li class="active"><a href="#">商品管理列表</a></li>
        <li><a href="{{U('add')}}">添加商品</a></li>
    </ul>
</div>

<table class="hd-table hd-table-list">
    <thead>
    <tr>
        <td class="hd-w50">编号</td>
        <td>商品名称</td>
        <td>上架时间</td>
        <td>栏目</td>
        <td>商品类型</td>
        <td class="hd-w100">操作</td>
    </tr>
    </thead>
    <tbody>
    {{foreach from="$data['data']" value="$field"}}
    <tr>
        <td>{{$field['goods_id']}}</td>
        <td>
        {{if value="$field['thumb_pic']"}}
             <img src="{{$field['thumb_pic']}}" style="width:50px">
        {{endif}}
            {{$field['goods_name']}}        
        </td>
        <td>
            {{date('Y/m/d',$field['create_at'])}}
        </td>
        <td>
            {{$field['cat_name']}}
        </td>
        <td>
            #
        </td>
        <td class="hd-w150">
            <a href="{{U('edit',array('goods_id'=>$field['goods_id']))}}">修改</a> |
            <a href="{{U('Store/index',array('goods_id'=>$field['goods_id']))}}">库存</a> |
            <a href="javascript:del({{$field['goods_id']}})">放进回收站</a>
        </td>
    </tr>
    {{endforeach}}
    </tbody>
</table>
<ul class="pagination">
    {{$data['page']}}
</ul>
</body>
<script type="text/javascript">
    function del(id)
    {
        if(confirm('你确认将此商品放进回收站?'))
        {
            location.href = "{{U('del')}}&id="+id;
        }
    }
</script>
</html>